<template>
  <el-button type="danger" @click="open">删除</el-button>
</template>

<script>
export default {
  methods: {
    open() {
      this.$confirm("此操作将永久删除, 是否继续?", "提示", {
        confirmButtonText: "删除",
        cancelButtonText: "取消",
        confirmButtonClass:"el-button el-button--danger",
        type: "warning"
      })
        .then(() => {
          this.$message({
            type: "success",
            message: "删除成功!"
          });
          this.$emit("del");
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除"
          });
        });
    }
  }
};
</script>

<style>
</style>